package me.sdevil507.biz.common.sysdict.service;

import me.sdevil507.biz.common.sysdict.po.SysDict;
import me.sdevil507.supports.jpa.PageParamsDTO;
import me.sdevil507.supports.jpa.SortParamsDTO;
import org.springframework.data.domain.Page;

import java.util.List;

public interface SysdictService {

    List<SysDict> findByTypeKey(String typeKey);

    List<SysDict> findByTypeKeyAndValue(String typeKey,String dvalue);

    List<SysDict> findByTypeKeyAndName(String typeKey,String dname);
    /**
     * @Description:
     * @Param:
     * @return:
     * @Author: kzl
     * @Date:
     */
    void create(SysDict sysDict);

    void delete(SysDict sysDict);

    void deleteByTypeKey(String typeKey);

    List<SysDict> findExistsByName(String name, Long parentId,Long id);

    List<SysDict> findExistsByCode(String code, Long parentId,Long id);

    List<SysDict> readAll(SysDict searchDTO, SortParamsDTO sortParamsDto);

    Page<SysDict> readAllByPage(SysDict searchDTO, PageParamsDTO pageParamsDto, SortParamsDTO sortParamsDto);

    List<SysDict> readAllParent();

    SysDict findOneById(Long id);

    SysDict findOneByCode(String code);
}

